<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>Title</title>
    <style>
        body{
            font-size: 30px;
            font-family: Arial;
            background-color: cornflowerblue;
        }
        main{
            min-height: 500px;
            margin: 0;
            padding: 0;
            display: flex;
            flex-flow: row;
        }
        .div1{
            margin: 4px;
            padding: 5px;
            border-radius:7px ;
            background-color: hotpink;
            flex: 3;
            order: 2;
        }
        .div2{
            margin: 4px;
            padding: 5px;
            border-radius: 7px;
            background-color: lime;
            flex: 1;
            order: 1;
        }
        .div3{
            margin: 4px;
            padding: 5px;
            border-radius:7px ;
            background-color: navajowhite;
            flex: 1;
            order:3;
        }
        header,footer{
            display: block;
            margin: 4px;
            margin: 4px;
            padding: 5px;
            min-height: 100px;
            border:2px solid #330f2d;
            border-radius: 7px;
            background-color: #dddddd;
        }
        @media all and(max-width: 640px) {
            main{
                flex-flow: column;
            }
            .div1,.div2,.div3{
                order: 0;
            }
            .div2,.div3,header,footer{
                min-height: 50px;
                max-height: 50px;
            }
        }
    </style>
</head>

<body>
<header>header</header>
<main>
    <div class="div1">我是div1</div>
    <div class="div2">我是div2</div>
    <div class="div3">我是div3</div>
</main>
<footer>footer</footer>
</body>
</html>